﻿<navigation:Page  x:Class="LEEAAttendanceControl.Views.Locations"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services" 
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480" Title="Devices">
    <Grid x:Name="LayoutRoot">
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <StackPanel Orientation="Vertical">
                <Grid Background="#404041">
                    <TextBlock Text="Locations" Foreground="White" FontSize="14" FontWeight="Bold" Margin="5,3,3,3"
                               HorizontalAlignment="Left" VerticalAlignment="Center"/>
                </Grid>
                
                <riaControls:DomainDataSource Name="LocationsDataSource" AutoLoad="True" QueryName="GetLocations"
                                       LoadingData="LocationsDataSource_LoadingData">
                    <riaControls:DomainDataSource.DomainContext>
                        <my:LEEAContext />
                    </riaControls:DomainDataSource.DomainContext>
                </riaControls:DomainDataSource>

                <sdk:DataGrid Name="GRDLocation" AutoGenerateColumns="False"
                      ItemsSource="{Binding ElementName=LocationsDataSource, Path=Data}" IsReadOnly="True"
                      RowDetailsVisibilityMode="VisibleWhenSelected">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn x:Name="NameColumn" Binding="{Binding Path=Name}" Header="Location Name"
                                        Width="400" />
                        <sdk:DataGridTextColumn x:Name="DeviceIdColumn" Binding="{Binding Path=DeviceId, Mode=OneWay}"
                                        Header="Device ID" IsReadOnly="True" Width="383" />
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</navigation:Page>